1. Field of the Invention
This invention relates to the field of computer software, more specifically, to object-oriented computer applications.
Portions of the disclosure of this patent document contain material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever. SUN, SUN MICROSYSTEMS, the SUN logo, SOLARIS, SPARC, “WRITE ONCE, RUN ANYWHERE”, JAVA, JAVAOS, JAVASTATION and all JAVA-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
2. Background Art
With advancements in network technology, the use of networks for facilitating the distribution of media information, such as text, graphics, and audio, has grown dramatically, particularly in the case of the Internet and the World Wide Web. One area of focus for current developmental efforts is in the field of web applications and network interactivity. In addition to passive media content, such as HTML definitions, computer users or “clients” coupled to the network are able to access or download application content, in the form of applets, for example, from “servers” on the network.
To accommodate the variety of hardware systems used by clients, applications or applets are distributed in a platform-independent format such as the JAVA™. class file format. Object-oriented applications are formed from multiple class files that are accessed from servers and downloaded individually as needed. Class files contain byte code instructions. A “virtual machine” process that executes on a specific hardware platform loads the individual class files and executes the bytecodes contained within.
A problem with the class file format and the class loading process is that no mechanism is provided to ensure timely delivery of class files. The timing of the storage, transfer and processing of the individual class files is thus not scheduled or guaranteed to occur within a particular time frame. Also, an application may contain many class files, all of which are loaded and processed in separate transactions. Thus, a delay in the delivery of even one class file slows down the application and degrades performance.
These problems can be understood from a review of general object-oriented programming and an example of a current network application environment.
Object-Oriented Programming
Object-oriented programming is a method of creating computer programs by combining certain fundamental building blocks, and creating relationships among and between the building blocks. The building blocks in object-oriented programming systems are called “objects.” An object is a programming unit that groups together a data structure (one or more instance variables) and the operations (methods) that can use or affect that data. Thus, an object consists of data and one or more operations or procedures that can be performed on that data. The joining of data and operations into a unitary building block is called “encapsulation.”
An object can be instructed to perform one of its methods when it receives a “message.” A message is a command or instruction sent to the object to execute a certain method. A message consists of a method selection (e.g., method name) and a plurality of arguments. A message tells the receiving object what operations to perform.
One advantage of object-oriented programming is the way in which methods are invoked. When a message is sent to an object, it is not necessary for the message to instruct the object how to perform a certain method. It is only necessary to request that the object execute the method. This greatly simplifies program development.
Object-oriented programming languages are predominantly based on a “class” scheme. The class-based object-oriented programming scheme is generally described in Lieberman, “Using Prototypical Objects to Implement Shared Behavior in Object-Oriented Systems,” OOPSLA 86 Proceedings, September 1986, pp. 214–223.
A class defines a type of object that typically includes both variables and methods for the class. An object class is used to create a particular instance of an object. An instance of an object class includes the variables and methods defined for the class. Multiple instances of the same class can be created from an object class. Each instance that is created from the object class is said to be of the same type or class.
To illustrate, an employee object class can include “name” and “salary” instance variables and a “set_salary” method. Instances of the employee object class can be created, or instantiated for each employee in an organization. Each object instance is said to be of type “employee.” Each employee object instance includes “name” and “salary” instance variables and the “set_salary” method. The values associated with the “name” and “salary” variables in each employee object instance contain the name and salary of an employee in the organization. A message can be sent to an employee's employee object instance to invoke the “set_salary” method to modify the employee's salary (i.e., the value associated with the “salary” variable in the employee's employee object).
A hierarchy of classes can be defined such that an object class definition has one or more subclasses. A subclass inherits its parent's (and grandparent's etc.) definition. Each subclass in the hierarchy may add to or modify the behavior specified by its parent class. Some object-oriented programming languages support multiple inheritance where a subclass may inherit a class definition from more than one parent class. Other programming languages support only single inheritance, where a subclass is limited to inheriting the class definition of only one parent class. The JAVA™ programming language also provides a mechanism known as an “interface” which comprises a set of constant and abstract method declarations. An object class can implement the abstract methods defined in an interface. Both single and multiple inheritance are available to an interface. That is, an interface can inherit an interface definition from more than one parent interface.
An object is a generic term that is used in the object-oriented programming environment to refer to a module that contains related code and variables. A software application can be written using an object-oriented programming language whereby the program's functionality is implemented using objects.
JAVA™ Programming and Execution
A JAVA™ program is composed of a number of classes and interfaces. Unlike many programming languages, in which a program is compiled into machine-dependent, executable program code, JAVA™ classes are compiled into machine independent bytecode class files. Each class contains code and data in a platform-independent format called the class file format. The computer system acting as the execution vehicle contains a program called a virtual machine, which is responsible for executing the code in JAVA™ classes. The virtual machine provides a level of abstraction between the machine independence of the bytecode classes and the machine-dependent instruction set of the underlying computer hardware. A “class loader” within the virtual machine is responsible for loading the bytecode class files as needed, and either an interpreter executes the bytecodes directly, or a “just-in-time” (JIT) compiler transforms the bytecodes into machine code, so that they can be executed by the processor.
Sample JAVA™ Network Application Environment
FIG. 1 is a block diagram illustrating a sample JAVA™ network environment comprising a client platform 102 coupled over a network 101 to a server 100 for the purpose of accessing JAVA™ class files for execution of a JAVA™ application or applet.
In FIG. 1, server 100 comprises JAVA™ development environment 104 for use in creating the JAVA™ class files for a given application. The JAVA™ development environment 104 provides a mechanism, such as an editor and an applet viewer, for generating class files and previewing applets. A set of J JAVA™ core classes 103 comprise a library of JAVA™ classes that can be referenced by source files containing other/new JAVA™ classes. From JAVA™ development environment 104, one or more JAVA™ source files 105 are generated. JAVA™ source files 105 contain the programmer readable class definitions, including data structures, method implementations and references to other classes. JAVA™ source files 105 are provided to JAVA™ compiler 106, which compiles JAVA™ source files 105 into compiled “.class” files 107 that contain bytecodes executable by a JAVA™ virtual machine. Bytecode class files 107 are stored (e.g., in temporary or permanent storage) on server 100, and are available for download over network 101.
Client platform 102 contains a JAVA™ virtual machine (JVM) 111 which, through the use of available native operating system (O/S) calls 112, is able to execute bytecode class files and execute native O/S calls when necessary during execution.
JAVA™ class files are often identified in applet tags within an HTML (hypertext markup language) document. A web server application 108 is executed on server 100 to respond to HTTP (hypertext transport protocol) requests containing URLs (universal resource locators) to HTML documents, also referred to as “web pages.” When a browser application executing on client platform 102 requests an HTML document, such as by forwarding URL 109 to web server 108, the browser automatically initiates the download of the class files 107 identified in the applet tag of the HTML document. Class files 107 are typically downloaded from the server and loaded into virtual machine 111 individually as needed.
It is typical for the classes of a JAVA™ program to be loaded as late during the program's execution as possible; they are loaded on demand from the network (stored on a server), or from a local file system, when first referenced during the JAVA™ program's execution. The virtual machine locates and loads each class file, parses the class file format, allocates memory for the class's various components, and links the class with other already loaded classes. This process makes the code in the class readily executable by the virtual machine.
Timely Delivery
There are a variety of applications for which JAVA™ byte code or serialized objects need to be delivered to clients in a timely fashion. For example, ensuring timely delivery of byte code is essential when JAVA™ byte code is used to control time aware media in a push scenario.
Currently, there has been no mechanism available for delivery of byte code in a timely fashion. Currently, the techniques for delivery of byte code use Transmission Control Protocol (TCP) to transmit byte code from servers to clients. TCP does not ensure timely delivery of information.
There are a number of schemes (e.g., Motion Picture Experts Group (MPEG) standards, such as MPEG-1, MPEG-2, MPEG-4, etc.) available for preparing time-sensitive data (e.g., audio, video, etc.) for transmission as media streams. Similarly, there are a number of schemes like Real-time Transport Protocol (RTP) and MPEG-2 transport stream, to deliver “time aware” media streams in a timely manner. “Time aware” information is information that carries with it additional information representing timing relevant to the use of the information. For example, information that includes time stamps indicating deadlines by which the information should be processed in certain ways is considered “time aware” information.
However, such techniques are designed to deliver media stream, such as audio and video data, not executable byte code. Media streams typically comprise information that is inherently tolerant of corruption or loss of integrity. For example, transient corruption of a few milliseconds of audio or video data creates only a brief distraction for a listener or viewer. However, the slightest corruption of executable byte code can prevent proper execution.
Moreover, one class file of byte code is often dependent upon other class files for proper execution. Existing techniques for timely delivery of media streams do not include provisions for these dependencies. Thus, a technique is needed to provide timely delivery of byte code.
A technique is needed to transform the class file (or a serialized object) into a time aware stream. If the JAVA™ byte code stream were made time aware, other real time transport mechanisms like RTP could be used to transport the stream in a timely fashion. Such a scheme would facilitate the use of byte code in any multicast or broadcast scenario. This would make it possible to transmit byte code using internet protocols like User Datagram Protocol (UDP). Without such a scheme UDP is unsuitable for delivery of byte code since UDP is an unreliable protocol (one that does not guarantee delivery of data). Transmission of byte code over an unreliable protocol could result in loss of portions of the byte code, which would prevent the byte code from executing properly.